<tr>
	<?php
//	$this->load->database();
//	$query = $this->db->query('select * from album order by name asc');
	$loop = 0;
	foreach ($query->result() as $row):
	if($row->cover=="" || $row->cover==false){
		$row->cover = "images/nopicture.jpg";
	} else {
		$que = $this->db->query("select thumbs from images where id_images='$row->cover' limit 1");
		foreach ($que->result() as $res):
			$row->cover = site_url(array('project','loadThumbsAlbum',$row->cover));
		endforeach;
	}
	$loop++;
		if($loop % 6==1){
				echo "</tr><tr>";
			}
	?>	
	 <td width="140" align="center" valign="top">
	 <a href="<?php echo site_url(array('project','openAlbum',$row->id_album))?>">
	 <img class="picture" src="<?php echo $row->cover?>" /></a>
	<br />
	 <a href="<?php echo site_url(array('project','openAlbum',$row->id_album))?>"><?php echo $row->name ?></a>
	<br /><br />
	</td>
	<?php endforeach ?> 
</tr>          